<?php
/**
 * Created by PhpStorm.
 * User: m1514
 * Date: 2017/1/6
 * Time: 10:45
 */

namespace Home\Controller;


use Common\Model\RegModel;

class LoginController extends HomeQController
{
    public function index(){
        if(IS_POST){

            $data=(new RegModel());
            if($data->Login()){
                $this->success('登录成功',u('index/index'));die;
            }else{
                $this->error($data->getError(),u('index'));die;
            }
        }
        //显示模板
        $this->display();
    }
    public function out(){
        session(null);
        $this->redirect('Login/index', array(), 1, '退出成功,页面跳转中...');
    }
}